//
//  CRJ_TabBarViewController.m
//  BaseProject
//
//  Created by 小崔 on 2024/3/26.
//

#import "CRJ_TabBarViewController.h"

#import "CRJ_BaseNavController.h"

#import "CRJ_UIKitViewController.h"
#import "CRJ_ComponentsViewController.h"
#import "CRJ_LabViewController.h"

@interface CRJ_TabBarViewController ()

@end

@implementation CRJ_TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    CRJ_UIKitViewController *uikitViewController = [[CRJ_UIKitViewController alloc] init];
    uikitViewController.hidesBottomBarWhenPushed = NO;
    CRJ_BaseNavController *uikitNavController = [[CRJ_BaseNavController alloc] initWithRootViewController:uikitViewController];
    uikitViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"UIKit" image:[UIImage imageNamed:@"icon_tabbar_uikit"] selectedImage:[UIImage imageNamed:@"icon_tabbar_uikit_selected"]];
    
    // UIComponents
    CRJ_ComponentsViewController *componentViewController = [[CRJ_ComponentsViewController alloc] init];
    componentViewController.hidesBottomBarWhenPushed = NO;
    CRJ_BaseNavController *componentNavController = [[CRJ_BaseNavController alloc] initWithRootViewController:componentViewController];
    componentViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Components" image:[UIImage imageNamed:@"icon_tabbar_component"] selectedImage:[UIImage imageNamed:@"icon_tabbar_component_selected"]];
    
    // Lab
    CRJ_LabViewController *labViewController = [[CRJ_LabViewController alloc] init];
    labViewController.hidesBottomBarWhenPushed = NO;
    CRJ_BaseNavController *labNavController = [[CRJ_BaseNavController alloc] initWithRootViewController:labViewController];
    labViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Lab" image:[UIImage imageNamed:@"icon_tabbar_lab"] selectedImage:[UIImage imageNamed:@"icon_tabbar_lab_selected"]];
    
    // window root controller
    self.viewControllers = @[uikitNavController, componentNavController, labNavController];
    // Do any additional setup after loading the view.
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
